/* Copyright (c) 2018 VMware, Inc. All rights reserved. -- VMware Confidential */
Prerequisites
    - install node.js version >= 8.9
    - go to <tool-root-dir>, open a command/terminal window and execute "npm install"

Operation
The tool supports two migration modes:
	AUTOMATIC: Automatically migrates your project to a new one in which all calls to the bridge APIs are replaced with calls to the new JS APIs.
	    The plugin.xml structure is also migrated.
	MANUAL: Generates a migration patch file where all calls to the bridge APIs are replaced with calls to the new JS APIs.
	    This file can be manually edited to select a subset of the changes to be applied.
	    Apply the changes from the generated and potentially edited migration patch file.
	    plugin.xml changes are also part of the migration patch file.

Example change from a migration patch file:
{
	old: WEB_PLATFORM.getObjectId()
	new: htmlClientSdk.getContextObjects()[0]
	line: 10
	character: 0
}
means that WEB_PLATFORM.getObjectId on line 10 is going to be replaced with htmlClientSdk.getContextObjects()[0]

Usage
	The tool accepts the following parameters:
		- project - The root path of the project to migrate
		- migrationDestination - The root path of the migrated project
		- migrationFile - The destination path of the generated migration patch file. Used for "MANUAL" migration mode only.
		- overwrite - overwrite existing files

	Commands
		- migrateProject --project [path to the project] --migrationDestination [path to the destination]
			this command executes AUTOMATIC migration mode
		- generateMigrationFile --project [path to the project] --migrationFile [path to the migration file]
			this command executes the generation part of the MANUAL migration mode
		- applyMigrationFile --project [path to the project] --migrationFile [path to the migration file] --migrationDestination [path to the destination]
			this command applies the changes from a migration patch file (generated as part of the MANUAL migration mode)

	The tool is executed with:
		npm run -s migrate [command] -- [parameters]

Notes
* After using the tool, search for WEB_PLATFORM in your code base to remove unused WEB_PLATFORM occurrences.
* Some old APIs (Such as "callActionController") do not have an equivalent in the new JS APIs so a warning for each such API call will be issued during migration.
    You should change your application logic to not rely on this API and remove these APIs from your application as they will produce runtime exceptions otherwise.
* Commented code is not processed by the migration tool
* Some of the parameters require full path to locate a directory or a file.